home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 21.zip / BS1 part 21 / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].7z / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].adf / rexx.lzh / InsertPersonalInfo.pprx < prev    next >
Text File  |  1992-03-13  |  2KB  |  107 lines

  1. /*
  2. @BInsertPersonalInfo  @P@ICopyright Gold Disk Inc., February, 1992
  3. This Genie will insert personal information which is saved in the PPage.config file into a text box at the current cursor location.
  4. (See also EnterPersonalInfo Genie).
  5. */
  6.  
  7. cr = '0a'x
  8.  
  9. boxnum   = ppm_BoxNum()
  10.  
  11. if word(ppm_GetState(), 1) ~= "3" then
  12.     exit_msg("You must be select a box to edit first")
  13.  
  14. if getclip(ppuser_name) = '' & getclip(ppuser_company) = '' then
  15.    call getinfo()
  16. info  = "1 - Name"cr"2 - Company Name"cr"3 - Address"cr"4 - City"cr"5 - State / Province"cr"6 - Country"cr"7 - Zipcode / PostalCode"cr"8 - Phone"cr"9 - Fax"
  17. sepinfo = "Separate by comma"cr"Separate by carriage return"
  18.  
  19. info = ppm_SelectFromList("Select options", 28, 5, 1, info)
  20. if info = '' then exit_msg()
  21. sepinfo = ppm_SelectFromList("Select options", 30, 2, 0, sepinfo)
  22. if sepinfo = '' then exit_msg()
  23.  
  24. if pos('comma', sepinfo) ~= 0 then
  25.    delimiter = ', '
  26. else
  27.    delimiter = '0a'x
  28. string = ''
  29. do while info ~= ''
  30.    parse var info item '0a'x info
  31.    text = getclip("PPUSER_"upper(word(item, 3)))
  32.    if text ~= '' then string = string || delimiter || text
  33. end
  34.  
  35. string = delstr(string, 1, 1)
  36. call ppm_InsertText(string)
  37. exit_msg()
  38.  
  39. /*
  40.  * exit_msg PROCEDURE
  41.  */
  42. exit_msg: procedure
  43. do
  44.    parse arg message
  45.    if message ~= '' then call ppm_Inform(1,message,)
  46.    exit
  47. end
  48.  
  49. /*
  50.  * getinfo PROCEDURE
  51.  */
  52. getinfo: procedure
  53.  
  54. cr = '0a'x
  55. do
  56.    startclip   = "/*****Start Clips*****/"
  57.    endclip     = "/*****End Clips*****/"
  58.    startupfile = "s:ppage.config"
  59.    startup     = ''
  60.    clist     = 0
  61.  
  62. if ~open(file, startupfile, "r") then
  63.    do
  64.       address command
  65.       call pragma(d, "rexx:")
  66.       call EnterPersonalInfo.pprx()
  67. exit_msg()
  68.    end
  69.  
  70. do while ~eof(file)
  71.       text = readln(file)
  72.    if text = startclip then
  73.    do
  74.        clist = 2
  75.        clips.1 = startclip
  76.        do while ~ eof(file)
  77.       text = readln(file)
  78.                   if strip(text) = '' then iterate
  79.       clips.clist = text
  80.       clist = clist + 1
  81.       if text = endclip then
  82.       do
  83.           text = ''
  84.           leave
  85.       end
  86.        end
  87.        clist = clist - 1
  88.    end
  89.    startup = startup || cr || text
  90.     end
  91.  
  92.     call close(file)
  93.  
  94.    if exists(startupfile) then
  95.    do
  96.        address command
  97.        'copy' startupfile startupfile".bak"
  98.        address
  99.    end
  100.  
  101. call EnterPersonalInfo.pprx()
  102.    call close(file)
  103.  
  104.    return
  105. end
  106.  
  107.